package com.arofoxmsn.model;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import com.arofoxmsn.model.comunication.MobilePhone;
import com.arofoxmsn.model.identifiedObject.MyObject;
import com.arofoxmsn.model.location.Location;
import com.arofoxmsn.model.profile.Profile;
import com.arofoxmsn.model.userstate.AbstractUserState;

@Entity
public class User {
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
    @Column(name = "id", unique = true, nullable = false)
	private long id;
	
	private String displayName;
	
	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
	private Location currentLocation;
	
	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
	private Profile profile;
	
	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
	private MobilePhone mobile;
	
	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
	private MyObject myObject;
	
	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
	private AbstractUserState state;
	
	@Column(name="user_state") 
	@Enumerated(EnumType.ORDINAL) 
	private UserState userState;
	
	public long getId() {return id;}
	public void setId(long id) {this.id = id;}
	
	public String getDisplayName() {return displayName;}
	public void setDisplayName(String displayName) {this.displayName = displayName;}
	
	public Location getCurrentLocation() {return currentLocation;}
	public void setCurrentLocation(Location currentLocation) {this.currentLocation = currentLocation;}
	
	public Profile getProfile() {return profile;}
	public void setProfile(Profile profile) {this.profile = profile;}
	
	public MobilePhone getMobile() {return mobile;}
	public void setMobile(MobilePhone mobile) {this.mobile = mobile;}
	
	public MyObject getMyObject() {return myObject;}
	public void setMyObject(MyObject myObject) {this.myObject = myObject;}
	
	public AbstractUserState getState() {return state;}
	public void setState(AbstractUserState state) {this.state = state;}
	
	public UserState getUserState() {return userState;}
	public void setUserState(UserState userState) {this.userState = userState;}
	
}
